package tests;

import java.io.IOException;
import java.net.SocketException;
import java.util.List;

import network.NetworkEngine;

public class ReceiveRunner implements Runnable
{
	NetworkEngine e;
	public ReceiveRunner(NetworkEngine e){
		this.e = e;
	}
	@Override
	public void run()
	{
		List<Object> received;
		while(true){
			try {
				String threadName = Thread.currentThread().getName()+"\t"+this.getClass().getCanonicalName();
				System.out.println(threadName);
				received = e.update();
			} catch (IOException e) {
				break;
			}
			for(Object obj : received){
				System.out.println((String)obj);
			}
		}

	}

}
